package com.wzcl.app.service.impl;

import com.wzcl.app.dao.model.LoginRecord;
import com.wzcl.app.dao.repository.LoginRecordRepository;
import com.wzcl.app.model.dto.LoginRecordDto;
import com.wzcl.app.service.LoginRecordService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Log4j2
@Service
public class LoginRecordServiceImpl implements LoginRecordService{

    @Autowired
    private LoginRecordRepository loginRecordRepository;

    @Override
    public LoginRecord addLoginRecord(LoginRecordDto loginRecordDto) {
        LoginRecord loginRecord = new LoginRecord();
        BeanUtils.copyProperties(loginRecordDto,loginRecord,"id");
        return loginRecordRepository.save(loginRecord);
    }

    @Override
    public LoginRecord delLoginRecordById(Integer id) {
        return null;
    }

    @Override
    public LoginRecord updateLoginRecord(LoginRecordDto loginRecordDto) {
        return null;
    }

    @Override
    public LoginRecord getLoginRecordById(Integer id) {
        return null;
    }

    @Override
    public List<LoginRecord> getLoginRecordList(LoginRecordDto loginRecordDto) {
        return null;
    }
}
